home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 21
/
CU Amiga Magazine's Super CD-ROM 21 (1998)(EMAP Images)(GB)[!][issue 1998-04].iso
/
CUCD
/
Programming
/
MCC_MimeEditor
/
Developer
/
Autodocs
/
MCC_MimeEditor.doc
Wrap
Text File
|
1998-01-27
|
7KB
|
204 lines
TABLE OF CONTENTS
MimeEditor.mcc/MimeEditor.mcc
MimeEditor.mcc/MUIA_MimeEditor_Changed
MimeEditor.mcc/MUIA_MimeEditor_IconDrawer
MimeEditor.mcc/MUIA_MimeEditor_Okay
MimeEditor.mcc/MUIA_MimeEditor_Subject
MimeEditor.mcc/MUIA_MimeEditor_To
MimeEditor.mcc/MUIM_MimeEditor_InsertFile
MimeEditor.mcc/MUIM_MimeEditor_InsertText
MimeEditor.mcc/MUIM_MimeEditor_OpenFile
MimeEditor.mcc/MUIM_MimeEditor_SaveFile
MimeEditor.mcc/MimeEditor.mcc
MimeEditor.mcc is a class for dealing with MIME messages. It is a
subclass of group.mui.
Note: When you want to start a new message, you will have to insert
a text part (with MUIM_MimeEditor_InsertText) yourself, this will not
be done automatically when creating a new MimeEditor.mcc object.
The class is programmed by Ole Friis (ole_f@post3.tele.dk) and Leon
Woestenberg (leon@stack.nl).
MimeEditor.mcc/MUIA_MimeEditor_Changed
NAME
MUIA_MimeEditor_Changed -- [.SG], BOOL
FUNCTION
Indicates whether the user has made any modifications to the MIME
message or not. Use this tag to warn the user if he attempts to
cancel an edited message.
NOTE: If you use MUIM_MimeEditor_Insert#? and MUIM_MimeEditor_OpenFile,
this attribute will become TRUE. As the most normal use of MimeEditor.mcc
is to first create the object, then inserting a blank text part, do remem-
ber to set this attribute to FALSE after having inserted the text part.
Also, you cannot take notify on this attribute.
MimeEditor.mcc/MUIA_MimeEditor_IconDrawer
NAME
MUIA_MimeEditor_IconDrawer -- [I..], char *
FUNCTION
Create-time attribute used to set the drawer in which the image files
for the toolbar icons are found. These files are ("_S" stands for
"selected", "_G" stands for "ghosted):
Main toolbar icons: "MimeEditorStrip.buttons", "MimeEditor_S.buttons",
"MimeEditor_G.buttons".
The dummy ? sign: "PartButton.buttons", "PartButton_S.buttons",
"PartButton_G.buttons".
Text edit toolbar icons: "EditTextStrip.buttons",
"EditTextStrip_S.buttons", "EditTextStrip_G.buttons".
If you can find some more sensible names, please let me know!
Please note: The "..._S.buttons" and "..._G.buttons" files are not
needed, just use them if you want a spiffier interface.
Note: If this tag is not specified, "PROGDIR:Buttons/" is used.
MimeEditor.mcc/MUIA_MimeEditor_Okay
NAME
MUIA_MimeEditor_Okay -- [..G], ULONG
FUNCTION
Tells you what parts of the MIME message are correct. Use this
attribute if you want to be sure that the message is OK before
letting the user save it to disk.
The result is a ULONG. It must be interpreted this way ("result"
is the result you get):
If ((result & MUIV_MimeEditor_Okay_Subject) != 0), it means that
the subject has been specified by the user.
If ((result & MUIV_MimeEditor_Okay_To) != 0), it means that the
"To:" field contains at least one recipient.
If ((result & MUIV_MimeEditor_Okay_Contents) != 0), it means that
the MIME message is not empty.
Do not make any assumptions about the rest of the bits in the
result, because this attribute will be extended to using new bits
when new header fields etc. get implemented.
MimeEditor.mcc/MUIA_MimeEditor_Subject
NAME
MUIA_MimeEditor_Subject -- [I..], char *
FUNCTION
Text to put in the "Subject:" string gadget upon initialization.
MimeEditor.mcc/MUIA_MimeEditor_To
NAME
MUIA_MimeEditor_To -- [I..], char *
FUNCTION
Text to be put in the "To:" string gadget upon initialization.
MimeEditor.mcc/MUIM_MimeEditor_InsertFile
NAME
MUIM_MimeEditor_InsertFile
SYNOPSIS
DoMethod(obj,MUIM_MimeEditor_InsertFile,char *Filename);
FUNCTION
Inserts the file Filename into the editor.
RESULT
NONE
MimeEditor.mcc/MUIM_MimeEditor_InsertText
NAME
MUIM_MimeEditor_InsertText
SYNOPSIS
DoMethod(obj,MUIM_MimeEditor_InsertText,char *InitText);
FUNCTION
Inserts a blank text part in the editor, containing only InitText
(or nothing if InitText is NULL).
RESULT
NONE
MimeEditor.mcc/MUIM_MimeEditor_OpenFile
NAME
MUIM_MimeEditor_OpenFile
SYNOPSIS
DoMethod(obj,MUIM_MimeEditor_OpenFile,char *Filename,char *Citestring,
char *StartText,char *SignatureText);
FUNCTION
Opens the file Filename. If CiteString is anything else than NULL, the
file will be loaded in the same manner as when you use "Reply" in your
mailer: Everything else than text parts is discarded, and the remaining
text parts get CiteString in front of every line.
No matter what CiteString is, StartText is written at the start of every
text part. In CiteString the following control codes can be inserted:
%n: Name of original author.
%i: Initials of original author's name.
%f: First name of original author.
%e: E-mail address of original author.
%d: Date (in "YAM format").
%s: Subject.
More codes will probably be added in the future.
If SignatureText is not NULL, this string will be inserted at the end of
every loaded text part. Please note: You have to insert "\n-- \n" at the
start of SignatureText yourself if you want the "signature part indicator"
known from most mail programs.
RESULT
NONE (The editor field will contain an error message if the file could not
be opened or wasn't a MIME file)
MimeEditor.mcc/MUIM_MimeEditor_SaveFile
NAME
MUIM_MimeEditor_SaveFile
SYNOPSIS
DoMethod(obj,MUIM_MimeEditor_SaveFile,char *DestFile,char *FromAddress,
char **ExtraHeaders);
FUNCTION
Saves the current contents of the editor to a file. The required parameters
are:
DestFile - The destination file name. Please note: If you have previously
opened a file with MUIM_MimeEditor_Open, DestFile must *not* be the name
of the opened file. This is because, if some binary parts are in the
editor, it will just be copied directly from the original file, thus
saving resources.
FromAddress - The text to be put in the "From:" header field. *Must* be in
"normal e-mail format", which is:
ole_f@post3.tele.dk (Ole Friis)
ole_f@post3.tele.dk
Ole Friis <ole_f@post3.tele.dk>
"Friis, Ole" <ole_f@post3.tele.dk>
or similar) and *must* include an e-mail address. The FromAddress is
interpreted, and the e-mail address is used in the "Message-ID:" header
field.
ExtraHeaders - If you want to insert header lines at the main header part
of the saved message (e.g. "X-Mailer: Yo-Yo v. 4.3", this is the way to
do it. Simply give a NULL-terminated array of string pointers, and these
will be inserted at the top of the message. Don't worry if the strings
are too long, MimeEditor.mcc will take care of that.
RESULT
NONE